package org.tgit.gateway.config;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableAsync;
import org.tgit.gateway.common.ApiMonitorData;
/**
 * 
* @ClassName: AsyncLogConfig   
* @Description: TODO(异步调用)   
* @author fanzaijun 
* @date 2018年8月23日 下午5:31:20   
*
 */
@Configuration
@EnableAsync
public class AsyncLogConfig {
	//LOGGER
	private static final Logger LOGGER=LoggerFactory.getLogger(AsyncLogConfig.class);
	
	//异步日志录库
	@Async
	public void saveLog(ApiMonitorData dataLog) {
		//控制台打印
		LOGGER.info(dataLog.toString());
		//保存到数据库
	}
	//异步日志打印
	@Async
	public void consoleLog(ApiMonitorData dataLog) {
		//控制台打印
		LOGGER.info(dataLog.toString());
		//保存到数据库
	}
}
